package com.csdj.server.utils;

import com.csdj.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @Author xyx
 * @Date 2022/12/30 11:12
 * @ClassName: AdminUtils
 * @Description: TODO
 * @Version 1.0
 */
public class AdminUtils {
    /**
     * 获取当前 实例对象 Admin
     * @return
     */
    public static Admin getCurrentAdmin(){
        return ((Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal());
    }
}
